﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FinalMoviles
{
    public partial class FrmPagos : Form
    {
        public FrmPagos()
        {
            InitializeComponent();
            //pagos del cliente
            swDatos.Service ws = new swDatos.Service();
            DataTable dttpagos = ws.ObtenerTodosPagosCliente(1);
            dtPagVen.DataSource = dttpagos;
            //doctos vencido del cliente
            
            DataTable dttpagosv = ws.ObtenerTodosDoctosVencidos(1);
            dtVencidos.DataSource = dttpagosv;
            //doctos activos 
            
            DataTable dttpagosa = ws.ObtenerTodosDoctosActivos(1);
            dtActivos.DataSource = dttpagosa;
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            Menu fact = new Menu();
            this.Hide();
            fact.ShowDialog();
            this.Show();
        }

        private void btnConsulta_Click(object sender, EventArgs e)
        {
            swDatos.Service ws = new swDatos.Service();
            int no_fact = Convert.ToInt32(txtNoFact.Text);
            DataTable dttpagos = ws.ObtenerTodosPagosFactura(no_fact);
            dataGrid1.DataSource = dttpagos;
        }        
    }
}